package com.xinqi.controller;

import com.xinqi.dto.Result;
import com.xinqi.service.HelloService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xin麒
 * @date 2023/8/12 15:00
 */
@Slf4j
@RestController
@RequestMapping("/hello")
@Api("测试模块")
public class HelloController {
    @Autowired
    private HelloService helloService;

    @GetMapping("/{count}")
    @ApiOperation("do count by helloService")
    public Result processForCount(@PathVariable("count") Long count) {
        return Result.ok(helloService.processForCount(count));
    }


    @GetMapping("/myJdkPool/{count}")
    @ApiOperation("do count by myJdkPool")
    public Result myJdkPool(@PathVariable("count") Long count) {
        return Result.ok(helloService.myJdkPool(count));
    }


    @GetMapping("/testBySubmit/{count}")
    @ApiOperation("do count by testBySubmit")
    public Result testBySubmit(@PathVariable("count") Long count) {
        return Result.ok(helloService.testBySubmit(count));
    }


    @GetMapping("/myJdkPool2/{count}")
    @ApiOperation("do count by myJdkPool2")
    public Result myJdkPool2(@PathVariable("count") Long count) {
        return Result.ok(helloService.myJdkPool2(count));
    }

    @GetMapping("/testBySubmitByMyJdkPool2/{count}")
    @ApiOperation("do count by testBySubmitByMyJdkPool2")
    public Result testBySubmitByMyJdkPool2(@PathVariable("count") Long count) {
        return Result.ok(helloService.testBySubmitByMyJdkPool2(count));
    }



}
